package my.graduation.context;

/**
 * @Author: RavenLyn
 * @Date: 2024-11-28
 *
 * 用于存放当前线程的上下文
 * 存放用户id (adminId,doctorId,patientId)
 */

public class BaseContext {

    public static ThreadLocal<Integer> threadLocal = new ThreadLocal<>();

    public static void setCurrentId(Integer id){
        threadLocal.set(id);
    }

    public static Integer getCurrentId(){
        return threadLocal.get();
    }

    public static void removeCurrentId(){
        threadLocal.remove();
    }
}
